package com.qcy.serve.service.impl;

import java.util.List;
import com.qcy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qcy.serve.mapper.FangjuMapper;
import com.qcy.serve.domain.Fangju;
import com.qcy.serve.service.IFangjuService;

/**
 * 防具数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-25
 */
@Service
public class FangjuServiceImpl implements IFangjuService 
{
    @Autowired
    private FangjuMapper fangjuMapper;

    /**
     * 查询防具数据
     * 
     * @param id 防具数据主键
     * @return 防具数据
     */
    @Override
    public Fangju selectFangjuById(Long id)
    {
        return fangjuMapper.selectFangjuById(id);
    }

    /**
     * 查询防具数据列表
     * 
     * @param fangju 防具数据
     * @return 防具数据
     */
    @Override
    public List<Fangju> selectFangjuList(Fangju fangju)
    {
        return fangjuMapper.selectFangjuList(fangju);
    }

    /**
     * 新增防具数据
     * 
     * @param fangju 防具数据
     * @return 结果
     */
    @Override
    public int insertFangju(Fangju fangju)
    {
        fangju.setCreateTime(DateUtils.getNowDate());
        return fangjuMapper.insertFangju(fangju);
    }

    /**
     * 修改防具数据
     * 
     * @param fangju 防具数据
     * @return 结果
     */
    @Override
    public int updateFangju(Fangju fangju)
    {
        fangju.setUpdateTime(DateUtils.getNowDate());
        return fangjuMapper.updateFangju(fangju);
    }

    /**
     * 批量删除防具数据
     * 
     * @param ids 需要删除的防具数据主键
     * @return 结果
     */
    @Override
    public int deleteFangjuByIds(Long[] ids)
    {
        return fangjuMapper.deleteFangjuByIds(ids);
    }

    /**
     * 删除防具数据信息
     * 
     * @param id 防具数据主键
     * @return 结果
     */
    @Override
    public int deleteFangjuById(Long id)
    {
        return fangjuMapper.deleteFangjuById(id);
    }
}
